function AsStringEncoder() {

	this.encode = function(t, o) {
		
		if(t.equals(Types.STRING) && (o == null || o == undefined))
			return Types.NULL_TOKEN;

		if(t.equals(Types.STRING) && o == "")
			return Types.EMPTY_STRING_TOKEN;

		return urlencode(""+o);
	}
	
	function urlencode(str) {
		return encodeURIComponent(str);
		//escape(str).repace(/\+/g,'%2B').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
	}
	
	this.isEncodeable = function(t) {
		return t.equalsAny([Types.UNKNOWN, Types.STRING, Types.BOOLEAN, Types.CHAR, Types.DOUBLE, 
							Types.FLOAT, Types.INT, Types.LONG, Types.SHORT, Types.BYTE]);
	}

}
